<template>
    <view class="page-template-list">
		<view class="p-4" v-if="longList.list.length == 0">
            <u-empty text="暂无数据" mode="list"></u-empty>
        </view> 
		<u-cell-group>
			<u-cell-item v-for="(item,index) in longList.list" :key="index" :title="item.guildName" value="查看会员" @click="proxy.$util.gotoPage('/packageA/branch/member', {guildId: item.guildId})"></u-cell-item>
		</u-cell-group>
    </view>
</template>
<script setup lang="ts">
import {onShow, onPullDownRefresh, onReachBottom, onLoad } from '@dcloudio/uni-app';
import { useLonglist } from '@/static/fn/longList';
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
let initObj = reactive({
	// listApi:'/admin/guilds/getFenHUiGuildsByUserId',
	listApi: '/admin/guilds/getGuildsByUserId',
    resKey: 'data',
});
let { searchForm, listApi, longList, getList} = useLonglist(initObj);
onPullDownRefresh(() => {
	getList('refresh');
	setTimeout( () => {
		uni.stopPullDownRefresh();
	}, 1000);
});
onReachBottom(() =>{
	getList();
});
onLoad(e => {
	console.log(e);
	if(e.type== 'isMaster'){
		listApi.value = '/admin/guilds/getFenHUiGuildsByUserId'
	}
});
onShow(() => {
	getList('refresh');
})
</script>